import {SELECT} from "@/utils/enums/type-enums";

export const defaultForms = [{
  label: null, card: [
    {
      type: SELECT,
      label: '空间类型',
      name: 'dictionaryCode',
      dictionaryCode: 'storey',
      span: 6,
      options: [
        {label: '楼栋', value: 'storey'},
        {label: '楼层', value: 'floor'},
        {label: '房间', value: 'room'},
      ]
    },
    {line: true},
    {
      type: 'text',
      label: '楼栋名称',
      name: 'constName',
      placeholder: '输入楼栋名称'
    },
    {line: true},
    {
      type: 'switch',
      label: '状态',
      name: 'status',
      status: 1,
      activeText: '是',
      inactiveText: '否',
      activeValue: 1,
      inactiveValue: 0,
      placeholder: '输入备注'
    },
    {line: true},
    {
      type: 'textarea',
      label: '备注',
      name: 'remark',
      span: '16',
      style: 'width: 400px',
      placeholder: '输入备注'
    },
  ]
}]
export const defaultRules = {
  dictionaryCode: [{required: true, message: '空间类型不能为空', trigger: 'blur'}],
  constName: [{required: true, message: '楼栋名称不能为空', trigger: 'blur'}],
}
export const floorForms = [{
  label: null, card: [
    {
      label: '空间类型',
      name: 'dictionaryCode',
      type: 'select',
      dictionaryCode: 'floor',
      span: 6,
      options: [
        {label: '楼栋', value: 'storey'},
        {label: '楼层', value: 'floor'},
        {label: '房间', value: 'room'},
      ]
    },
    {line: true},
    {
      type: 'select',
      label: '楼栋',
      name: 'parentCode',
      placeholder: '选择楼栋',
      options: []
    },
    {line: true},
    {
      type: 'text',
      label: '楼层名称',
      name: 'constName',
      placeholder: '输入楼层名称'
    },
    {line: true},
    {
      type: 'switch',
      label: '状态',
      name: 'status',
      status: 1,
      activeText: '是',
      inactiveText: '否',
      activeValue: 1,
      inactiveValue: 0,
      placeholder: '输入备注'
    },
    {line: true},
    {
      type: 'textarea',
      label: '备注',
      name: 'remark',
      span: '16',
      style: 'width: 400px',
      placeholder: '输入备注'
    },
  ]
}]
export const floorRules = {
  dictionaryCode: [{required: true, message: '空间类型不能为空', trigger: 'blur'}],
  constName: [{required: true, message: '楼层名称不能为空', trigger: 'blur'}],
  parentCode: [{required: true, message: '楼栋不能为空', trigger: 'blur'}],
}
export const roomForms = [{
  label: null, card: [
    {
      label: '空间类型',
      name: 'dictionaryCode',
      type: 'select',
      dictionaryCode: 'room',
      span: 6,
      options: [
        {label: '楼栋', value: 'storey'},
        {label: '楼层', value: 'floor'},
        {label: '房间', value: 'room'},
      ]
    },
    {line: true},
    {
      type: 'cascader',
      label: '空间',
      name: 'parentCodes',
      placeholder: '选择空间',
      options: []
    },
    {line: true},
    {
      type: 'text',
      label: '房间名称',
      name: 'constName',
      placeholder: '输入房间名称'
    },
    {line: true},
    {
      type: 'switch',
      label: '状态',
      name: 'status',
      status: 1,
      activeText: '是',
      inactiveText: '否',
      activeValue: 1,
      inactiveValue: 0,
      placeholder: '输入备注'
    },
    {line: true},
    {
      type: 'textarea',
      label: '备注',
      name: 'remark',
      span: '16',
      style: 'width: 400px',
      placeholder: '输入备注'
    },
  ]
}]
export const roomRules = {
  dictionaryCode: [{required: true, message: '空间类型不能为空', trigger: 'blur'}],
  constName: [{required: true, message: '房间不能为空', trigger: 'blur'}],
  parentCode: [{required: true, message: '空间不能为空', trigger: 'blur'}],
}